<template>
	<view class="p-[20rpx]">
		<up-parse :domain="BASE_URL" :content="content"></up-parse>
	</view>
</template>

<script setup>
import { ref } from 'vue';
import { getAgreement, getPrivacy } from '@/config/api/wxConfig';
import { BASE_URL } from '@/utils/http';
import { onLoad } from '@dcloudio/uni-app';
onLoad((options) => {
	if (options.index == 0) {
		getAgree();
	} else {
		getPriv();
	}
});
const content = ref('');
const getAgree = async () => {
	try {
		const res = await getAgreement();
		content.value = res.data.agreement.content;
	} catch (error) {
		//TODO handle the exception
	}
};
const getPriv = async () => {
	try {
		const res = await getPrivacy();
		content.value = res.data.privacy.content;
	} catch (error) {
		//TODO handle the exception
	}
};
</script>

<style></style>
